Repository navigation
feat(id): wire serve loaded budgets into WorldProtocol (#2247) - #8240
Conversation
…col (#2247) The [budgets] table was parsed at startup and held in _started_server_config, but cmd_serve built the production protocol with with_local_node, which hard-wires BudgetPolicy::default() — so configured per-counterparty caps were inert. cmd_serve now builds the protocol through world_protocol_for, which passes the loaded config budgets to WorldProtocol::with_budgets when a config was given and keeps the coded defaults otherwise. Tests: serve_world_protocol_enforces_configured_budgets (configured policy incl. a counterparty override reaches the evaluator and an over-cap charge is refused BudgetExhausted) and serve_world_protocol_defaults_budgets_without_config. NOTE: the id lib test target does not compile on current main for an unrelated reason (world_store.rs tests use JOURNAL_VERSION_EXECUTION_PROFILE unqualified — #7081, task 14503); cargo check --lib is clean and serve.rs itself compiles with no errors.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 45 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
…getPolicy; world spawn needs a tokio runtime
|
Verification update (task 9172, lane code-m): |
Summary
WorldProtocolthatid serveregisters:cmd_servenow builds the protocol through a newworld_protocol_forhelper, which passesstarted.config.budgets().clone()toWorldProtocol::with_budgetswhen--server-configwas given, and keepswith_local_node(coded defaults) when it was not.[budgets]table was parsed and held at startup scope (_started_server_config) but never reached the protocol, so configured per-counterparty caps were inert in production. The binding is renamed tostarted_server_confignow that it has a live consumer.Tests — status (2026-11-10, task 9172, lane code-m)
serve_world_protocol_enforces_configured_budgets(a config withper_peer_bytes_per_hourplus a[[budgets.counterparty]]row produces a protocol whose evaluator carries exactly that policy; the counterparty row replaces the peer's limits vialimits_for_peer; a 600-byte charge against the 500-byte window is refusedRefusalReason::BudgetExhausted— frame dropped, peer not disconnected) andserve_world_protocol_defaults_budgets_without_config(no config →BudgetPolicy::default()).idlib test target does not compile on current main for an unrelated, pre-existing reason —pkgs/id/src/world_store.rstests useJOURNAL_VERSION_EXECUTION_PROFILEunqualified (E0599, sole error in the build; serve.rs itself compiles with no errors). That break is issue id: lib test does not compile on main - ChainExt initializers missing rotation field (event_store/sync.rs, log_sync.rs) #7081, already owned by task 14503. When it lands:cargo test --manifest-path pkgs/id/Cargo.toml --lib serve_world_protocoland--lib budget, then merge this PR.Scope per task 9172: no parser or BudgetPolicy semantics changed; #5119 pull-gate/freshness untouched.
Refs #2247 (the config/parser surface landed earlier; this is the serve wiring remainder).